package dnl.confij;

/**
 * A <code>ConfigurationSource</code> is responsible for persisting and
 * loading a <code>Configuration</code> object.
 * 
 * @author Daniel Or
 * 
 */
public interface ConfigurationSource {

	/**
	 * Loads the configuration from the underlying source.
	 * 
	 * @param config
	 *            a <code>Configuraion</code> object that will be populated
	 *            with sections and parameters that are loaded from the source.
	 * @throws ConfigException
	 *             upon any loading error.
	 */
	public void loadConfiguration(Configuration config) throws ConfigException;

	/**
	 * Saves the configuration from the underlying source.
	 * 
	 * @param config
	 *            a <code>Configuraion</code> object which state will be
	 *            saved.
	 * @throws ConfigException
	 *             upon any saving error.
	 */
	public void saveConfiguration(Configuration config) throws ConfigException;
}
